Import the data

## An object of class Seurat 
## 51215 features across 3162 samples within 3 assays 
## Active assay: SCT (14612 features, 2000 variable features)
##  3 layers present: counts, data, scale.data
##  2 other assays present: RNA, HTO
##  2 dimensional reductions calculated: pca, umap

Here’re some representation

General conditions

Clusteres at res0.1

Clonotypes distributions

Cell cycle distribution

Cells inspection

I’ll inspect the expression of some markers to determine the cell types

This will help us determine any cluster that may not be of interest ! (clusters at res 0.1)

T lymphocytes

Other cell types

Basically here, we’re looking for

  • Monocytes & macrophages (CD14, LYZ)
  • NK cells (NKG7, GNLY)
  • B Lymphocytes (CD19, CD27)

As for the feature plots :

Clonotypes inspection

Now we’ll inspect the distribution of the clonotypes

Let’s group unique and low-count clones together

Now let’s see the distribution among the conditions and the clusters

Clones among conditions

Clones among clusters

Filtering cells

Now let’s filter unwanted cells

# define cells to remove :
# ---------------------- :
cells_rm <- WhichCells(
  SeuratObj, 
  expression = umap_1 > 6 | umap_2 > 4 
)

# subset seurat object :
# -------------------- :
SeuratObj_filt <- subset(SeuratObj, cells = setdiff(Cells(SeuratObj),cells_rm))

## second round :
## ------------ :
cells_rm <- WhichCells(
  SeuratObj_filt,
  expression = SCT_snn_res.0.1 == "3"
)

SeuratObj_filt <- subset(SeuratObj_filt, cells = setdiff(Cells(SeuratObj_filt),cells_rm))

Set a threshold of 30 cells minimum to be kept for further analysis (so any cluster below 30 will be filtered again)

Renaming clusters

TCR inspections

Now, let’s inspect the VDJ expression :

  • Among our conditions
  • Among the clonotypes





Cell cycle inspection

Now, let’s inspect the cell cycle of the TCRs :

Now, let’s inspect the cell cycle of the clonotypes :

Analysis duration : 45s

Time : 13:14:25

Session info

## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value
##  version  R version 4.4.2 (2024-10-31 ucrt)
##  os       Windows 11 x64 (build 26100)
##  system   x86_64, mingw32
##  ui       RTerm
##  language (EN)
##  collate  French_France.utf8
##  ctype    French_France.utf8
##  tz       Europe/Paris
##  date     2025-07-26
##  pandoc   3.2 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
##  quarto   NA @ C:\\PROGRA~1\\RStudio\\RESOUR~1\\app\\bin\\quarto\\bin\\quarto.exe
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package          * version date (UTC) lib source
##  abind              1.4-8   2024-09-12 [1] CRAN (R 4.4.1)
##  AnnotationDbi    * 1.68.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  ape                5.8-1   2024-12-16 [1] CRAN (R 4.4.2)
##  aplot              0.2.5   2025-02-27 [1] CRAN (R 4.4.3)
##  Biobase          * 2.66.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  BiocGenerics     * 0.52.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  BiocParallel       1.40.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  Biostrings         2.74.1  2024-12-16 [1] Bioconductor 3.20 (R 4.4.2)
##  bit                4.6.0   2025-03-06 [1] CRAN (R 4.4.3)
##  bit64              4.6.0-1 2025-01-16 [1] CRAN (R 4.4.3)
##  blob               1.2.4   2023-03-17 [1] CRAN (R 4.4.2)
##  bslib            * 0.9.0   2025-01-30 [1] CRAN (R 4.4.3)
##  cachem             1.1.0   2024-05-16 [1] CRAN (R 4.4.2)
##  circlize           0.4.16  2024-02-20 [1] CRAN (R 4.4.2)
##  cli                3.6.3   2024-06-21 [1] CRAN (R 4.4.2)
##  clue               0.3-66  2024-11-13 [1] CRAN (R 4.4.2)
##  cluster            2.1.6   2023-12-01 [2] CRAN (R 4.4.2)
##  clusterProfiler  * 4.14.4  2024-12-02 [1] Bioconductor 3.20 (R 4.4.2)
##  clustree         * 0.5.1   2023-11-05 [1] CRAN (R 4.4.2)
##  codetools          0.2-20  2024-03-31 [2] CRAN (R 4.4.2)
##  colorspace         2.1-1   2024-07-26 [1] CRAN (R 4.4.2)
##  ComplexHeatmap   * 2.22.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  conflicted       * 1.2.0   2023-02-01 [1] CRAN (R 4.4.3)
##  cowplot            1.1.3   2024-01-22 [1] CRAN (R 4.4.2)
##  crayon             1.5.3   2024-06-20 [1] CRAN (R 4.4.2)
##  data.table         1.17.0  2025-02-22 [1] CRAN (R 4.4.3)
##  DBI                1.2.3   2024-06-02 [1] CRAN (R 4.4.2)
##  deldir             2.0-4   2024-02-28 [1] CRAN (R 4.4.0)
##  devtools           2.4.5   2022-10-11 [1] CRAN (R 4.4.2)
##  digest             0.6.37  2024-08-19 [1] CRAN (R 4.4.2)
##  doParallel         1.0.17  2022-02-07 [1] CRAN (R 4.4.2)
##  DOSE               4.0.0   2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  dotCall64          1.2     2024-10-04 [1] CRAN (R 4.4.2)
##  dplyr            * 1.1.4   2023-11-17 [1] CRAN (R 4.4.2)
##  ellipsis           0.3.2   2021-04-29 [1] CRAN (R 4.4.2)
##  enrichplot         1.26.6  2025-01-09 [1] Bioconductor 3.20 (R 4.4.2)
##  evaluate           1.0.3   2025-01-10 [1] CRAN (R 4.4.3)
##  farver             2.1.2   2024-05-13 [1] CRAN (R 4.4.2)
##  fastDummies        1.7.5   2025-01-20 [1] CRAN (R 4.4.3)
##  fastmap            1.2.0   2024-05-15 [1] CRAN (R 4.4.2)
##  fastmatch          1.1-6   2024-12-23 [1] CRAN (R 4.4.2)
##  fgsea              1.32.2  2024-12-19 [1] Bioconductor 3.20 (R 4.4.2)
##  fitdistrplus       1.2-2   2025-01-07 [1] CRAN (R 4.4.3)
##  foreach            1.5.2   2022-02-02 [1] CRAN (R 4.4.2)
##  fs                 1.6.6   2025-04-12 [1] CRAN (R 4.4.3)
##  future             1.40.0  2025-04-10 [1] CRAN (R 4.4.3)
##  future.apply       1.11.3  2024-10-27 [1] CRAN (R 4.4.2)
##  generics           0.1.3   2022-07-05 [1] CRAN (R 4.4.2)
##  GenomeInfoDb       1.42.3  2025-01-27 [1] Bioconductor 3.20 (R 4.4.2)
##  GenomeInfoDbData   1.2.13  2024-12-22 [1] Bioconductor
##  GetoptLong         1.0.5   2020-12-15 [1] CRAN (R 4.4.2)
##  ggforce            0.4.2   2024-02-19 [1] CRAN (R 4.4.2)
##  ggfun              0.1.8   2024-12-03 [1] CRAN (R 4.4.2)
##  ggplot2          * 3.5.2   2025-04-09 [1] CRAN (R 4.4.3)
##  ggplotify          0.1.2   2023-08-09 [1] CRAN (R 4.4.2)
##  ggraph           * 2.2.1   2024-03-07 [1] CRAN (R 4.4.2)
##  ggrepel          * 0.9.6   2024-09-07 [1] CRAN (R 4.4.2)
##  ggridges           0.5.6   2024-01-23 [1] CRAN (R 4.4.2)
##  ggsci            * 3.2.0   2024-06-18 [1] CRAN (R 4.4.3)
##  ggtangle           0.0.6   2024-12-18 [1] CRAN (R 4.4.2)
##  ggtree             3.14.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  GlobalOptions      0.1.2   2020-06-10 [1] CRAN (R 4.4.2)
##  globals            0.17.0  2025-04-16 [1] CRAN (R 4.4.2)
##  glue               1.8.0   2024-09-30 [1] CRAN (R 4.4.2)
##  GO.db              3.18.0  2024-12-24 [1] Bioconductor
##  goftest            1.2-3   2021-10-07 [1] CRAN (R 4.4.0)
##  GOSemSim           2.32.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  graphlayouts       1.2.2   2025-01-23 [1] CRAN (R 4.4.3)
##  gridExtra          2.3     2017-09-09 [1] CRAN (R 4.4.2)
##  gridGraphics       0.5-1   2020-12-13 [1] CRAN (R 4.4.2)
##  gson               0.1.0   2023-03-07 [1] CRAN (R 4.4.2)
##  gtable             0.3.6   2024-10-25 [1] CRAN (R 4.4.2)
##  htmltools          0.5.8.1 2024-04-04 [1] CRAN (R 4.4.2)
##  htmlwidgets        1.6.4   2023-12-06 [1] CRAN (R 4.4.2)
##  httpuv             1.6.15  2024-03-26 [1] CRAN (R 4.4.3)
##  httr               1.4.7   2023-08-15 [1] CRAN (R 4.4.2)
##  ica                1.0-3   2022-07-08 [1] CRAN (R 4.4.0)
##  igraph             2.1.4   2025-01-23 [1] CRAN (R 4.4.3)
##  IRanges          * 2.40.1  2024-12-05 [1] Bioconductor 3.20 (R 4.4.2)
##  irlba              2.3.5.1 2022-10-03 [1] CRAN (R 4.4.2)
##  iterators          1.0.14  2022-02-05 [1] CRAN (R 4.4.2)
##  jquerylib          0.1.4   2021-04-26 [1] CRAN (R 4.4.2)
##  jsonlite           2.0.0   2025-03-27 [1] CRAN (R 4.4.3)
##  KEGGREST           1.46.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  KernSmooth         2.23-24 2024-05-17 [2] CRAN (R 4.4.2)
##  knitr            * 1.50    2025-03-16 [1] CRAN (R 4.4.3)
##  labeling           0.4.3   2023-08-29 [1] CRAN (R 4.4.0)
##  later              1.4.2   2025-04-08 [1] CRAN (R 4.4.3)
##  lattice            0.22-6  2024-03-20 [2] CRAN (R 4.4.2)
##  lazyeval           0.2.2   2019-03-15 [1] CRAN (R 4.4.2)
##  lifecycle          1.0.4   2023-11-07 [1] CRAN (R 4.4.2)
##  listenv            0.9.1   2024-01-29 [1] CRAN (R 4.4.2)
##  lmtest             0.9-40  2022-03-21 [1] CRAN (R 4.4.2)
##  magrittr           2.0.3   2022-03-30 [1] CRAN (R 4.4.2)
##  MASS               7.3-61  2024-06-13 [2] CRAN (R 4.4.2)
##  Matrix             1.7-1   2024-10-18 [2] CRAN (R 4.4.2)
##  matrixStats        1.5.0   2025-01-07 [1] CRAN (R 4.4.3)
##  memoise            2.0.1   2021-11-26 [1] CRAN (R 4.4.2)
##  mime               0.13    2025-03-17 [1] CRAN (R 4.4.3)
##  miniUI             0.1.2   2025-04-17 [1] CRAN (R 4.4.2)
##  munsell            0.5.1   2024-04-01 [1] CRAN (R 4.4.2)
##  nlme               3.1-166 2024-08-14 [2] CRAN (R 4.4.2)
##  org.Hs.eg.db     * 3.20.0  2024-12-22 [1] Bioconductor
##  parallelly         1.43.0  2025-03-24 [1] CRAN (R 4.4.3)
##  patchwork          1.3.0   2024-09-16 [1] CRAN (R 4.4.2)
##  pbapply            1.7-2   2023-06-27 [1] CRAN (R 4.4.2)
##  pillar             1.10.2  2025-04-05 [1] CRAN (R 4.4.3)
##  pkgbuild           1.4.7   2025-03-24 [1] CRAN (R 4.4.3)
##  pkgconfig          2.0.3   2019-09-22 [1] CRAN (R 4.4.2)
##  pkgload            1.4.0   2024-06-28 [1] CRAN (R 4.4.2)
##  plotly             4.10.4  2024-01-13 [1] CRAN (R 4.4.2)
##  plyr               1.8.9   2023-10-02 [1] CRAN (R 4.4.2)
##  png                0.1-8   2022-11-29 [1] CRAN (R 4.4.0)
##  polyclip           1.10-7  2024-07-23 [1] CRAN (R 4.4.1)
##  profvis            0.4.0   2024-09-20 [1] CRAN (R 4.4.2)
##  progressr          0.15.1  2024-11-22 [1] CRAN (R 4.4.2)
##  promises           1.3.2   2024-11-28 [1] CRAN (R 4.4.2)
##  purrr              1.0.4   2025-02-05 [1] CRAN (R 4.4.3)
##  qvalue             2.38.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  R.methodsS3        1.8.2   2022-06-13 [1] CRAN (R 4.4.0)
##  R.oo               1.27.0  2024-11-01 [1] CRAN (R 4.4.1)
##  R.utils            2.13.0  2025-02-24 [1] CRAN (R 4.4.3)
##  R6                 2.6.1   2025-02-15 [1] CRAN (R 4.4.3)
##  RANN               2.6.2   2024-08-25 [1] CRAN (R 4.4.2)
##  RColorBrewer       1.1-3   2022-04-03 [1] CRAN (R 4.4.0)
##  Rcpp               1.0.14  2025-01-12 [1] CRAN (R 4.4.3)
##  RcppAnnoy          0.0.22  2024-01-23 [1] CRAN (R 4.4.2)
##  RcppHNSW           0.6.0   2024-02-04 [1] CRAN (R 4.4.2)
##  remotes            2.5.0   2024-03-17 [1] CRAN (R 4.4.2)
##  reshape2           1.4.4   2020-04-09 [1] CRAN (R 4.4.2)
##  reticulate         1.42.0  2025-03-25 [1] CRAN (R 4.4.3)
##  rjson              0.2.23  2024-09-16 [1] CRAN (R 4.4.1)
##  rlang              1.1.4   2024-06-04 [1] CRAN (R 4.4.2)
##  rmarkdown          2.29    2024-11-04 [1] CRAN (R 4.4.2)
##  ROCR               1.0-11  2020-05-02 [1] CRAN (R 4.4.2)
##  RSpectra           0.16-2  2024-07-18 [1] CRAN (R 4.4.2)
##  RSQLite            2.3.9   2024-12-03 [1] CRAN (R 4.4.2)
##  rstudioapi         0.17.1  2024-10-22 [1] CRAN (R 4.4.2)
##  Rtsne              0.17    2023-12-07 [1] CRAN (R 4.4.2)
##  S4Vectors        * 0.44.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  sass               0.4.10  2025-04-11 [1] CRAN (R 4.4.3)
##  scales             1.3.0   2023-11-28 [1] CRAN (R 4.4.2)
##  scattermore        1.2     2023-06-12 [1] CRAN (R 4.4.2)
##  sctransform        0.4.1   2023-10-19 [1] CRAN (R 4.4.2)
##  sessioninfo        1.2.3   2025-02-05 [1] CRAN (R 4.4.3)
##  Seurat           * 5.2.1   2025-01-24 [1] CRAN (R 4.4.3)
##  SeuratObject     * 5.0.2   2024-05-08 [1] CRAN (R 4.4.2)
##  shape              1.4.6.1 2024-02-23 [1] CRAN (R 4.4.0)
##  shiny            * 1.10.0  2024-12-14 [1] CRAN (R 4.4.2)
##  sp               * 2.2-0   2025-02-01 [1] CRAN (R 4.4.3)
##  spam               2.11-1  2025-01-20 [1] CRAN (R 4.4.3)
##  spatstat.data      3.1-6   2025-03-17 [1] CRAN (R 4.4.3)
##  spatstat.explore   3.4-2   2025-03-21 [1] CRAN (R 4.4.3)
##  spatstat.geom      3.3-6   2025-03-18 [1] CRAN (R 4.4.3)
##  spatstat.random    3.3-3   2025-03-19 [1] CRAN (R 4.4.3)
##  spatstat.sparse    3.1-0   2024-06-21 [1] CRAN (R 4.4.2)
##  spatstat.univar    3.1-2   2025-03-05 [1] CRAN (R 4.4.3)
##  spatstat.utils     3.1-3   2025-03-15 [1] CRAN (R 4.4.3)
##  stringi            1.8.7   2025-03-27 [1] CRAN (R 4.4.3)
##  stringr          * 1.5.1   2023-11-14 [1] CRAN (R 4.4.2)
##  survival           3.7-0   2024-06-05 [2] CRAN (R 4.4.2)
##  tensor             1.5     2012-05-05 [1] CRAN (R 4.4.0)
##  tibble           * 3.2.1   2023-03-20 [1] CRAN (R 4.4.2)
##  tidygraph          1.3.1   2024-01-30 [1] CRAN (R 4.4.2)
##  tidyr            * 1.3.1   2024-01-24 [1] CRAN (R 4.4.2)
##  tidyselect         1.2.1   2024-03-11 [1] CRAN (R 4.4.2)
##  tidytree           0.4.6   2023-12-12 [1] CRAN (R 4.4.2)
##  treeio             1.30.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  tweenr             2.0.3   2024-02-26 [1] CRAN (R 4.4.2)
##  UCSC.utils         1.2.0   2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  urlchecker         1.0.1   2021-11-30 [1] CRAN (R 4.4.2)
##  usethis            3.1.0   2024-11-26 [1] CRAN (R 4.4.2)
##  uwot               0.2.3   2025-02-24 [1] CRAN (R 4.4.3)
##  vctrs              0.6.5   2023-12-01 [1] CRAN (R 4.4.2)
##  viridis            0.6.5   2024-01-29 [1] CRAN (R 4.4.2)
##  viridisLite        0.4.2   2023-05-02 [1] CRAN (R 4.4.2)
##  withr              3.0.2   2024-10-28 [1] CRAN (R 4.4.2)
##  writexl          * 1.5.4   2025-04-15 [1] CRAN (R 4.4.3)
##  xfun               0.51    2025-02-19 [1] CRAN (R 4.4.3)
##  xtable             1.8-4   2019-04-21 [1] CRAN (R 4.4.2)
##  XVector            0.46.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  yaml               2.3.10  2024-07-26 [1] CRAN (R 4.4.1)
##  yulab.utils        0.2.0   2025-01-29 [1] CRAN (R 4.4.3)
##  zlibbioc           1.52.0  2024-10-29 [1] Bioconductor 3.20 (R 4.4.1)
##  zoo                1.8-14  2025-04-10 [1] CRAN (R 4.4.3)
## 
##  [1] C:/Users/juba/AppData/Local/R/win-library/4.4
##  [2] C:/Program Files/R/R-4.4.2/library
##  * ── Packages attached to the search path.
## 
## ──────────────────────────────────────────────────────────────────────────────